#pragma once

#include "../Xml/Forward.h"
#include "../Shared/GObjHelpers.hpp"
#include "../Shared/TypesRegistry.hpp"

namespace BuildNG
{
  class TaskSequence;
  class Task;
  
  class BuildContext;

  class TaskSequence : public Object
  {
  public:
    TaskSequence();

    void load_from_xml(const Xml::Element &xml);

    void run(BuildContext &context) const;

  private:
    std::vector<Glib::RefPtr<Task> > tasks;
  };

  class Task : public Object
  {
  public:
    Task();

    virtual void load_from_xml(const Xml::Element &xml) = 0;

    virtual void run(BuildContext &context) const = 0;
  };

  typedef TypesRegistry<Task> TaskTypesRegistry;
  typedef TaskTypesRegistry::TypeInfo TaskTypeInfo;
  extern TaskTypesRegistry task_types_registry;
}

